package components
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import mx.controls.Button;
	import mx.controls.Label;
	import mx.controls.TextArea;
	import mx.controls.Tree;
	import mx.events.ResizeEvent;
	
	import nl.wv.extenders.panel.SuperPanel;
	
	import tools.*;
	
	public class Reply{
		private var panel:SuperPanel = new SuperPanel();
		private var tekst:TextArea = new TextArea();
		private var tool:Tool = new Tool();
		private var label1:Label = new Label();
		public function Reply(p:SuperPanel){
			panel = p;
			label1.x = 10;
			label1.y = 27;
			label1.width = panel.width-30;
			label1.height = 25;
			tekst.x = 10;
			tekst.y = 45;
			tekst.height = panel.height-70;
	 		tekst.width=panel.width-30;
	 		tekst.editable = false;
			panel.addChild(tekst);
			panel.addChild(label1);
			panel.addEventListener(ResizeEvent.RESIZE, onResize);
		}
		
		public function onResize(e:ResizeEvent):void{
	 		tekst.width=panel.width-30;
			label1.width = panel.width-30;
			tekst.height = panel.height-70;
		}
		
		public function show(t:String, u:String, d:String, v:String):void{
			label1.htmlText = "Odgovorio: <b>"+u+"</b> dana: <b>"+d+"</b> u <b>"+v+"</b>";
			tekst.htmlText = tool.DecodeTekst(t);	
		}
	}
}